package com.unmarshaller.propertiesunmarshaller.transformer;

import java.lang.reflect.Field;

import javax.xml.crypto.dsig.TransformException;

import com.unmarshaller.propertiesunmarshaller.ITransformer;

/**
 * double类型转换赋值
 * @author hongxiao.z
 * @date	2013-10-21
 */
public class DoubleTransformer implements ITransformer
{

	@Override
	public void transformer(Field field, String value) throws TransformException 
	{
		try
		{
			field.set(null, Double.parseDouble(value));
		}
		catch(Exception e)
		{
			throw new TransformException("value:" + value + " invalid, is not transformer --- " + field.getType().getSimpleName() + " to " + field.getName());
		}
	}

}
